How to populate options of UUI-Select?
# help-with-umbraco
a
I'm reading through the UUI documentation and the example code doesn't actually show how to attach complex data such as an array to the UUI-Select component. I've tried this in my modal's render() method, and it doesn't work: render() { const targetOptions: Array = [ { name: 'Carrot', value: 'orange' }, { name: 'Cucumber', value: 'green' }, { name: 'Aubergine', value: 'purple' }, { name: 'Blueberry', value: 'Blue' }, { name: 'Banana', value: 'yellow' }, { name: 'Strawberry', value: 'red' }, ]; return html``; }
GOT IT: render() { const targetOptions: Array = [ { name: 'Carrot', value: 'orange' }, { name: 'Cucumber', value: 'green' }, { name: 'Aubergine', value: 'purple' }, { name: 'Blueberry', value: 'Blue' }, { name: 'Banana', value: 'yellow' }, { name: 'Strawberry', value: 'red' }, ]; return html ``; }
e
It needs to be in render?
a
Render is a good place for my use case, but I think you can put it elsewhere. The trick to binding was .options= which I was missing
87 Views